package java46_oo4;

//教务处
public class ScoreStat {
	public double getAvg2(double java, double db, double cshap) {
		java += 6;
		db += 6;
		cshap += 6;
		System.out.println("在计算过程中：java:" + java + ",db=" + db + ",csharp:"
				+ cshap);
		return (java + db + cshap) / 3;
	}

	public double getAvg(Student s) {
		if (s.name.equals("刘志")) {
			s.csharp += 5;
			s.java += 5;
			s.db += 5;
		}
		if (s.name.equals("张洋")) {
			s.csharp -= 1;
			s.java -= 1;
			s.db -= 1;
		}
		System.out.println("计算过程中：");
		s.show();
		double v = 0;
		v = (s.csharp + s.db + s.java) / 3;
		return v;
	}

	public float getAvgHeight(Student[] h) {
		float f = 0;
		for (Student s : h) {
			f += s.height;
		}
		return f / h.length;
	}
}
